home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / makebin.com / BINDEMO1.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-04-16  |  920 b   |  44 lines

  1.  
  2. {$M 1024,0,0}    {use the smallest memory possible}
  3. {$F+,R-}         {we want this to be allocated as FAR}
  4.  
  5. {BINDEMO1  V1.01  Copyright 1989  Michael Day   as of 16 April 1989}
  6. { all rights reserved }
  7. PROGRAM BinDemo1;
  8. uses BinIpc;
  9.  
  10. const Pass : integer = 1;
  11. var   Dbs : string;
  12.  
  13. procedure Pad(var S:string);
  14. begin
  15.   while length(S) < pred(sizeof(S)) do
  16.     S := S+' ';
  17. end;
  18.  
  19. function fstr(I:integer):string;
  20. var S:string;
  21. begin
  22.   str(I,S);
  23.   fstr := S;
  24. end;
  25.  
  26. begin
  27.   if IPC = nil then
  28.   begin
  29.     writeln('Hey, you''re trying to run this from DOS. No can do.');
  30.     halt(1);
  31.   end;
  32.   BinLoadCheck;
  33.   writeln('Number of times we have entered the BIN program: ',Pass);
  34.   if GetDbString(DbS) then
  35.   begin
  36.     writeln(Dbs);
  37.     Dbs := 'This is message '+fstr(Pass)+' passed back from the BIN program';
  38.     Pad(Dbs);
  39.     if SetDbString(DbS) then {nop};
  40.   end;
  41.   inc(Pass);
  42. end.
  43.  
  44.